﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace giaodien
{
    class UI
    {
        static int DiChuyen, X, Y;
        static public void Exit(Form frm) {
            DialogResult ok = MessageBox.Show("Bạn muốn thoát", "Thong báo", MessageBoxButtons.OKCancel);
            if (ok == DialogResult.OK)
                frm.Dispose();
        }
        static public void Mini(Form frm) {
            frm.WindowState = FormWindowState.Minimized;
        }
        static public void MouseDown(MouseEventArgs e) {
            DiChuyen = 1;
            X = e.X;
            Y = e.Y;
        }
        static public void MouseUp() {
            DiChuyen = 0;
        }
        static public void MouseMove(Form frm, int X0,int Y0) {
            if (DiChuyen == 1)
            {
                frm.SetDesktopLocation(X0 - X, Y0 - Y);
            }
        }
    }
}
